home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / OpenGL 1.0 SDK / Source / Libraries / glut / glut_modifier.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  755 b   |  37 lines  |  [TEXT/CWIE]

  1.  
  2. /* Copyright (c) Mark J. Kilgard, 1994. */
  3.  
  4. /* This program is freely distributable without licensing fees 
  5.    and is provided without guarantee or warrantee expressed or 
  6.    implied. This program is -not- in the public domain. */
  7.  
  8. #include "gl.h"
  9. #include "agl.h"
  10. #include "glut.h"
  11. #include "glutint.h"
  12.  
  13.  
  14. int glutGetModifiers(void)
  15. {
  16.     int modifiers;
  17.  
  18.     if(__glutModifierMask == (unsigned int) ~0)
  19.     {
  20.         __glutWarning("glutCurrentModifiers: do not call outside core input callback.");
  21.         return 0;
  22.     }
  23.     
  24.     modifiers = 0;
  25.     
  26.     if(__glutModifierMask & shiftKey)
  27.         modifiers |= GLUT_ACTIVE_SHIFT;
  28.         
  29.     if(__glutModifierMask & controlKey)
  30.         modifiers |= GLUT_ACTIVE_CTRL;
  31.         
  32.     if(__glutModifierMask & optionKey)
  33.         modifiers |= GLUT_ACTIVE_ALT;
  34.     
  35.     return modifiers;
  36. }
  37.